import React, { Component } from 'react'
import {AppContext} from './AppContext'

const WithContext = (Component) =>{
    return (props) => {
        <AppContext.Consumer>
            {({ state , actions}) => {
                return <Component {...props} data={state} actions={actions}></Component>
            }}
        </AppContext.Consumer>
    }
}